package com.sunagy.demand.backend.controller;

import com.sunagy.demand.backend.VO.ResultVO;
import com.sunagy.demand.backend.config.MazConfig;
import com.sunagy.demand.backend.utils.ResultVOUtil;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * desc：#TODO fill me ！
 * author：三餘無夢生
 * date：2018/4/27
 * time：上午12:15
 */
@Slf4j
@RestController
@RequestMapping("/config")
@Api(value = "通用配置更新", description = "自动更新wechat配置和maz配置")
public class ConfigAutoUpdateController {

    @Autowired
    private MazConfig mazConfig;
    @ApiOperation(value = "配置更新钩子", notes = "直接发送post请求钩子触发自动更新配置")
    @ApiResponses({
            @ApiResponse(code = 500, message = "接口异常")
    })
    @RequestMapping(method = RequestMethod.POST)
    public ResultVO<String> update() {
        return ResultVOUtil.success(mazConfig.getMqTest());
    }
}
